package com.register.service;

import com.register.dao.RegisterDao;
import com.register.pojo.Register;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service("registerService")
public class RegisterService {
    @Autowired
    private RegisterDao registerDao;

    public int deleteRegister(int id){
        return registerDao.deleteRegister(id);
    }
    public int addRegister(Register register){
        int money = 0;
        if(register.getDoctor_type() == 1)
            money=50;
        else if(register.getDoctor_type()  == 2)
            money=30;
        else if(register.getDoctor_type()  == 3)
            money=25;
        register.setPrice_r(money);
        // System.out.println(register.getPrice_r());
        return registerDao.addRegister(register);
    }

}
